package com.byl.common.validate;

import java.util.Map;

/**
 * Created by Administrator on 2019/7/23.
 */
public class ValidateUtils {

    /**
     * 验证参数中是否含有密码参数 且两次密码一致
     * @param map
     * @return true  密码一致通过
     */
    public static boolean validatePassword(Map map) {
        if (!map.containsKey("password") || !map.containsKey("confirmPassword"))
            return false;
        Object password = map.get("password");
        if (null == password)
            return false;
        Object confirmPassword = map.get("confirmPassword");
        if (null == confirmPassword)
            return false;
        if (!password.toString().equals(confirmPassword.toString()))
            return false;
        return true;
    }
}
